﻿using System.Collections.Generic;
using Microsoft.Data.Schema.ScriptDom.Sql;
using System;
using System.IO;


namespace Neznayka
{
    internal class VariableUsageVisitor : TSqlConcreteFragmentVisitor
    {
        private List<Literal> _variableReferences;

        #region ctor
        public VariableUsageVisitor()
        {
            _variableReferences = new List<Literal>();
        }
        #endregion

        #region properties
        public List<Literal> VariableReferences
        {
            get { return _variableReferences; }
        }
        #endregion

        #region overrides
        public override void ExplicitVisit(Literal node)
        {

            if (node.LiteralType == LiteralType.Variable)
            {
                _variableReferences.Add(node);
            }



        }
        #endregion

    }


}